]> dgit.raspbian.org Git - grub2.git/commitdiff
fix-for-gcc-2.16-2
authorGRUB Maintainers <pkg-grub-devel@alioth-lists.debian.net>
Wed, 23 Sep 2026 20:39:45 +0000 (21:39 +0100)
committerSteve McIntyre <93sam@debian.org>
Wed, 23 Sep 2026 20:39:45 +0000 (21:39 +0100)
commit ce6f2b57f5450a8239022dcbfb2d750f273b83cb
Author: Nicholas Vinson <nvinson234@gmail.com>
Date:   Tue Feb 24 19:48:42 2026 -0500

    util/resolve: Save str[r]chr() ret val to const data ptr

    With glibc-2.43 implementing the C23 standard, strrchr() and strchr()
    now return "const char *" when its first argument is "const char *".

    The fix is update all pointers receiving strrchr() and strchr()'s return
    values so that they are now "const char *" instead of "char *".

Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name fix-for-gcc-2.16-2.patch

util/resolve.c

index b6e26312fce81bc01333fdca6af3a46ab72cca52..254379195d48c625aa923c58ad54091fc0b7d521 100644 (file)
@@ -138,12 +138,12 @@ read_dep_list (FILE *fp)
 static char *
 get_module_name (const char *str)
 {
-  char *base;
-  char *ext;
+  const char *base;
+  const char *ext;
 
   base = strrchr (str, '/');
   if (! base)
-    base = (char *) str;
+    base = str;
   else
     base++;
 
@@ -164,9 +164,9 @@ get_module_name (const char *str)
 static char *
 get_module_path (const char *prefix, const char *str)
 {
-  char *dir;
+  const char *dir;
   char *base;
-  char *ext;
+  const char *ext;
   char *ret;
 
   ext = strrchr (str, '.');